import { createRouter, createWebHistory } from 'vue-router';
import Login from '../views/login/login.vue';

const routes = [
  {
    path: '/',
    redirect: '/login',
    component: Login,
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login/login.vue'),
  },
  {
    path: '/home',
    name: 'Home',
    redirect: '/board/Current',
    component: () => import('../views/home.vue'),
    children: [
      {
        path: '/board/all',
        name: 'all',
        component: () => import('../views/board/all.vue'),
      },
      {
        path: '/board/unpublished',
        name: 'unpublished',
        component: () => import('../views/board/unpublished.vue'),
      },
      {
        path: '/board/allproject',
        name: 'allproject',
        component: () => import('../views/board/allproject.vue'),
      },
      {
        path: '/board/Current',
        name: 'Current',
        component: () => import('../views/board/Current.vue'),
      },
      {
        path: '/board/pour',
        name: 'pour',
        component: () => import('../views/board/pour.vue'),
      },
      {
        path: '/basic/supplier',
        name: 'supplier',
        component: () => import('../views/basic/supplier.vue'),
      },
      {
        path: '/basic/staff',
        name: 'staff',
        component: () => import('../views/basic/staff.vue'),
      },
      {
        path: '/basic/role',
        name: 'role',
        component: () => import('../views/basic/role.vue'),
      },
      {
        path: '/basic/framework',
        name: 'framework',
        component: () => import('../views/basic/framework.vue'),
      },
      {
        path: '/evaluating/square',
        name: 'square',
        component: () => import('../views/evaluating/square.vue'),
      },
      {
        path: '/evaluating/project',
        name: 'project',
        component: () => import('../views/evaluating/project.vue'),
      },
      {
        path: '/evaluating/particulars',
        name: 'particulars',
        component: () => import('../views/evaluating/particulars.vue'),
      },
      {
        path: '/board/monthly',
        name: 'monthly',
        component: () => import('../views/board/monthly.vue'),
      },
      {
        path: '/centre/platform',
        name: 'platform',
        component: () => import('../views/centre/platform.vue'),
      },
      {
        path: '/centre/platformO',
        name: 'platformO',
        component: () => import('../views/centre/compentd/platform1.vue'),
      },
      {
        path: '/centre/platformT',
        name: 'platformT',
        component: () => import('../views/centre/compentd/platform2.vue'),
      },
      {
        path: '/centre/platformS',
        name: 'platformS',
        component: () => import('../views/centre/compentd/platform3.vue'),
      },
      {
        path: '/centre/platformF',
        name: 'platformF',
        component: () => import('../views/centre/compentd/platform4.vue'),
      },
      {
        path: '/centre/platformV',
        name: 'platformV',
        component: () => import('../views/centre/compentd/platform5.vue'),
      },
      {
        path: '/centre/platformX',
        name: 'platformX',
        component: () => import('../views/centre/compentd/platform6.vue'),
      },
      {
        path: '/centre/platformW',
        name: 'platformW',
        component: () => import('../views/centre/compentd/platform7.vue'),
      },
      {
        path: '/centre/platformA',
        name: 'platformA',
        component: () => import('../views/centre/compentd/platform8.vue'),
      },
      {
        path: '/board/crisis',
        name: 'crisis',
        component: () => import('../views/board/crisis.vue'),
      },
      {
        path: '/board/crisisIL',
        name: 'crisisIL',
        component: () => import('../views/board/crisisIL.vue'),
      },
      {
        path: '/board/analyse',
        name: 'analyse',
        component: () => import('../views/board/analyse.vue'),
      }
    ],
  },
  {
    path: '/:catchAll(.*)',
    component: () => import('../views/login/NotFound.vue'),
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
